/*
main.cpp
(c) 2010 Yury Hamenkov
This file is part of qWordCards.

qWordCards is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

qWordCards is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with qWordCards. If not, see <http://www.gnu.org/licenses/>.
*/

#include <QApplication>
#include "mainwindow.h"
#include <QDateTime>
#include <QTranslator>
#include <QDebug>

#define VERSION "0.1.2"

using namespace qWordCards;

int main (int argc, char** argv) {
	qsrand (QDateTime::currentDateTime().toTime_t());// Set rand seed
	
	QApplication app(argc, argv);
	if (QCoreApplication::arguments().count() > 1) {
		for (int i = 1; i < QCoreApplication::arguments().count(); i++) {
			QString arg = QCoreApplication::arguments().at(i);
			if (arg == "-v" || arg == "--version") {
				qDebug() << "qWordCards version: " << VERSION;
				return 0;
			} else {
				qDebug() << "Unknown argument: " << arg;
				return 0;
			}
		}
		return 0;
	}
	
	app.setQuitOnLastWindowClosed(false);

	QTranslator myappTranslator;
	myappTranslator.load("rus");
	app.installTranslator(&myappTranslator);


	MainWindow window;
	return app.exec();
}
